package com.ask.forMe.mapper;

import com.ask.forMe.model.entity.Item;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ItemMapper extends BaseMapper<Item> {
    /**
     * 根据销量获取TopN的商品
     * @param topN
     * @return
     */
    @Select("select id from item order by sales desc limit #{topN}")
    List<Long> getHotBySales(int topN);
}
